#include<bits/stdc++.h>
using namespace std;
const int maxn=200005;
int n,m,a[maxn],M[maxn],mmax,cnt,pos,f[maxn],T[maxn],L[maxn];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    // scanf("%d",&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",a+i);
        M[a[i]]++;L[a[i]]++;
        mmax=max(mmax,a[i]);
    }
    cnt=n;
    sort(a+1,a+n+1);
    int en=unique(a+1,a+n+1)-a-1;
    //cerr<<en<<" ";
    //for(int i=1;i<=en;i++) cerr<<a[i]<<" ";
    for(int i=2;i<=en;i++) f[i]=a[i]-a[i-1];
    //for(int i=1;i<=n;i ++) cerr<<a[i]<<" ";
    for(int i=1;i<=n;i++) if(!T[a[i]-a[i-1]]) f[++pos]=a[i]-a[i-1],T[a[i]-a[i-1]]=1;
    //or(int i=1;i<=pos;i++) cerr<<f[i]<<" ";
    //for(int i=1;i<=mmax;i++) if(M[i]) cerr<<M[i]<<' ';
    for(int r=1;r<=pos;r++)
    {
        int k=f[r];
        if(k==0) continue;
        for(int l=1;l<=en;l++)
        {
            int i=a[l];

            //if(M[i]==0) continue;
            //cerr<<i<<" "<<i+k<<" "<<M[i]<<" "<<M[k+i]<<endl;
            if(M[k+i]>=L[i])
                M[k+i]-=L[i],cnt-=L[i],L[i]=M[i]=0;
            else
                L[i]-=M[k+i],cnt-=M[k+i],M[k+i]=0;
            //cerr<<cnt<<' ';
        }
        //cerr<<endl;
    }
    // for(int i=1;i<=mmax;i++)
    // int k=unique(a+1,a+n+1)-a-1;
    printf("%d",cnt);
    return 0;
}
